<template>
	<div>
		<!--<el-dialog title="收货地址" :visible.sync="true">-->


		<el-row>
			<el-col :span="cardWidth" :key="-1" :offset="cardOffset">
				<el-collapse class="version">
					<el-collapse-item name="1"><!--style="max-height: 260px; overflow-y: auto;"-->
						<template slot="title">
							版本信息: {{version}}
						</template>

						<div style="color: #803500">新功能正在开发:</div>
						<div>指定股票的日均T-5,T-10等数据分析展示</div>
						<br/>

						<br/>
						<div style="color: green">当前更新:</div>
						<div>新功能: 软件全面重构,使用rust的实现; 方便维护,与新功能的迭代</div>
						<div>修复卡顿,请求数据使用线程池进行异步返回数据</div>
						<br/>

						<br/>
						<div style="color: darkviolet">程序说明:</div>
						<div>实时查看股票行情数据</div>
						<div>1: 行情数据展示: 财联社电报,第一财经,选股宝,云财经</div>
						<div>2: 问答互动数据展示: 深交所互动易,上证E互动</div>
						<div>3: 数据筛选功能</div>
						<div>4: 定时拉取新数据</div>
						<div>5: 已读未读匹配消息标示</div>
						<div>程序设置理念：操作简单, 数据清晰；</div>
						<div></div>

					</el-collapse-item>
				</el-collapse>
			</el-col>
		</el-row>

		<el-row>
			<el-col :span="cardWidth" :key="0" :offset="cardOffset">
				<el-card class="box-card">
					<div slot="header" class="clearfix">
						<span>设置常用参数</span>
					</div>

					<diV>
						<!--<div class="text item">
							<el-row>
								<label>刷新快捷键</label>
								<el-select class="setting-input" v-model="common.hotKey" placeholder="快捷键选择">
									<el-option
											v-for="item in ['无', 'F1', 'F2', 'F3', 'F4', 'F5','F6','F7','F8','F9','F10','F11','F12']"
											:key="item"
											:label="item"
											:value="item">
									</el-option>
								</el-select>
								&lt;!&ndash;<el-input style="float: right; width: 66%;" size="mini"  placeholder="功能暂时没有实现"></el-input>&ndash;&gt;
							</el-row>
						</div>
						<br/>-->
						<div class="text item">
							<el-row>
								<label>数据显示条数</label>
								<el-input class="setting-input" v-model.number.lazy="dataLimit" placeholder="请输入一个数字"></el-input>
							</el-row>
						</div>
						<br/>
						<!--
						<div class="text item">
							<el-row>
								<label>订阅</label>
								<el-switch class="setting-switch" v-model="keywordData.enable" :active-value="true" :inactive-value="false"></el-switch>
							</el-row>
						</div>
						-->
						<br/>
						<div class="text item">
							<el-row>
								<label>数据过滤</label>
								<el-switch class="setting-switch" v-model="filterData.enable" :active-value="true" :inactive-value="false"></el-switch>
							</el-row>
						</div>
					</diV>
				</el-card>
			</el-col>
		</el-row>
<!--
		<el-row>
			<el-col :span="cardWidth" :key="1" :offset="cardOffset">
				<el-card class="box-card">
					<div slot="header" class="clearfix">
						<span>
							财联社电报&nbsp;&nbsp;
							<el-switch class="setting-switch" v-model="cls.enable" :active-value="true" :inactive-value="false" active-color="#13ce66">
							</el-switch>
						</span>
					</div>
					<diV>
						<div class="text item">
							<el-row>
								<label>定时刷新频率(秒)</label>
								<el-input class="setting-input" :disabled="!cls.enable" v-model.number.lazy="cls.setInterval_time" placeholder="请输入内容"></el-input>
							</el-row>
						</div>
						<br/>
						<div class="text item">
							<el-row>
								<label>通知开关</label>
								<el-switch class="setting-switch" style="margin-left: 16%;" :disabled="!cls.enable" v-model="cls.enableNotice" :active-value="true" :inactive-value="false"></el-switch>
							</el-row>
						</div>
					</diV>
				</el-card>
			</el-col>
		</el-row>

		<el-row>
			<el-col :span="cardWidth" :key="3" :offset="cardOffset">
				<el-card class="box-card">
					<div slot="header" class="clearfix">
						<span>第一财经&nbsp;&nbsp;
							<el-switch
									class="setting-switch"
									v-model="dycj.enable"
									:active-value="true"
									:inactive-value="false"
									active-color="#13ce66"
							>
							</el-switch>
						</span>
					</div>
					<diV>
						<div class="text item">
							<el-row>
								<label>定时刷新频率(秒)</label>
								<el-input class="setting-input" :disabled="!dycj.enable" size="mini" v-model.number.lazy="dycj.setInterval_time" placeholder="请输入内容"></el-input>
							</el-row>
						</div>
						<br/>
						<div class="text item">
							<el-row>
								<label>通知开关</label>
								<el-switch class="setting-switch" :disabled="!dycj.enable" v-model="dycj.enableNotice" :active-value="true" :inactive-value="false"></el-switch>
							</el-row>
						</div>
					</diV>
				</el-card>
			</el-col>
		</el-row>

		<el-row>
			<el-col :span="cardWidth" :key="4" :offset="cardOffset">
				<el-card class="box-card">
					<div slot="header" class="clearfix">
						<span>选股宝&nbsp;&nbsp;
							<el-switch
									class="setting-switch"
									v-model="xuangubao.enable"
									:active-value="true"
									:inactive-value="false"
									active-color="#13ce66"
							>
							</el-switch>
						</span>
					</div>
					<diV>
						<div class="text item">
							<el-row>
								<label>定时刷新频率(秒)</label>
								<el-input class="setting-input" size="mini" :disabled="!xuangubao.enable" v-model.number.lazy="xuangubao.setInterval_time" placeholder="请输入内容"></el-input>
							</el-row>
						</div>
						<br/>
						<div class="text item">
							<el-row>
								<label>通知开关</label>
								<el-switch class="setting-switch" :disabled="!xuangubao.enable" v-model="xuangubao.enableNotice" :active-value="true" :inactive-value="false"></el-switch>
							</el-row>
						</div>
					</diV>
				</el-card>
			</el-col>
		</el-row>

		<el-row>
			<el-col :span="cardWidth" :key="5" :offset="cardOffset">
				<el-card class="box-card">
					<div slot="header" class="clearfix">
						<span>云财经&nbsp;&nbsp;
							<el-switch
									class="setting-switch"
									v-model="yuncaijing.enable"
									:active-value="true"
									:inactive-value="false"
									active-color="#13ce66"
							>
							</el-switch>
						</span>
					</div>
					<diV>
						<div class="text item">
							<el-row>
								<label>定时刷新频率(秒)</label>
								<el-input class="setting-input" :disabled="!yuncaijing.enable" v-model.number.lazy="yuncaijing.setInterval_time" placeholder="请输入内容"></el-input>
							</el-row>
						</div>
						<br/>
						<div class="text item">
							<el-row>
								<label>通知开关</label>
								<el-switch class="setting-switch" :disabled="!yuncaijing.enable" v-model="yuncaijing.enableNotice" :active-value="true" :inactive-value="false"></el-switch>
							</el-row>
						</div>
					</diV>
				</el-card>
			</el-col>
		</el-row>

		<el-row>
			<el-col :span="cardWidth" :key="2" :offset="cardOffset">
				<el-card class="box-card">
					<div slot="header" class="clearfix">
						<span>
							深交所互动易问答&nbsp;&nbsp;
							<el-switch class="setting-switch" v-model="hdy.enable" :active-value="true" :inactive-value="false" active-color="#13ce66">
							</el-switch>
						</span>
					</div>
					<diV>
						<div class="text item">
							<el-row>
								<label>定时刷新频率(秒)</label>
								<el-input class="setting-input" :disabled="!hdy.enable" v-model.number.lazy="hdy.setInterval_time" placeholder="请输入内容"></el-input>
							</el-row>
						</div>
						<br/>
						<div class="text item">
							<el-row>
								<label>通知开关</label>
								<el-switch class="setting-switch" :disabled="!hdy.enable" v-model="hdy.enableNotice" :active-value="true" :inactive-value="false"></el-switch>
							</el-row>
						</div>
					</diV>
				</el-card>
			</el-col>
		</el-row>

		<el-row>
			<el-col :span="cardWidth" :key="2" :offset="cardOffset">
				<el-card class="box-card">
					<div slot="header" class="clearfix">
						<span>
							上证E互动&nbsp;&nbsp;
							<el-switch class="setting-switch" v-model="edy.enable" :active-value="true" :inactive-value="false" active-color="#13ce66">
							</el-switch>
						</span>
					</div>
					<diV>
						<div class="text item">
							<el-row>
								<label>定时刷新频率(秒)</label>
								<el-input class="setting-input" :disabled="!edy.enable" v-model.number.lazy="edy.setInterval_time" placeholder="请输入内容"></el-input>
							</el-row>
						</div>
						<br/>
						<div class="text item">
							<el-row>
								<label>通知开关</label>
								<el-switch class="setting-switch" :disabled="!edy.enable" v-model="edy.enableNotice" :active-value="true" :inactive-value="false"></el-switch>
							</el-row>
						</div>
					</diV>
				</el-card>
			</el-col>
		</el-row>
		-->
		<!--</el-dialog>-->
	</div>

</template>

<script>

    const packageInfo = require('../../package.json');
    import configData from "../assets/data_handler/config_data"
    import keywordData from "../assets/data_handler/keyword_subscription_data"
    import filterData from "../assets/data_handler/filter_data"

    let vue = null

    export default {
        name: "setting",
        data() {
            return {
                filterData: filterData,
                keywordData: keywordData,
                common: configData.common,
	            cls: configData.cls,
                hdy: configData.hdy,
                dycj: configData.dycj,
                xuangubao: configData.xuangubao,
                yuncaijing: configData.yuncaijing,
                edy: configData.ehd,
                version: packageInfo.version,
                cardWidth: 20,
                cardOffset: 2,
				dataLimit: $EventBus.dataLimit,
            }
        },
        computed: {
        },
        watch: {
        	dataLimit: function (cur) {
				$EventBus.dataLimit = cur;
			}
        },
        props: {
        },
        created() {
            vue = this
        },
        mounted() {
        	$EventBus.$watch()
        },
        methods: {
        },
    }
</script>

<style scoped>
	.el-select {
		float: right !important;
		width: 66%;
	}

	.version {
		margin-right: 16px;
		margin-left: 12px;
		margin-bottom: 13px;
	}

	.setting-switch{
		float: right;
		margin-right: 70%;
	}

	.setting-input{
		float: right;
		width: 66%;
		margin-right: 10%;
	}
</style>
